import request from '@/utils/request.js';
import httpConfig from '@/config/http.js'
const prefixUrl = '/goods';
export default {
	findAll: (typeId, name) => {
		return request({
			url: `${prefixUrl}/findAll`,
			method: httpConfig.METHODS.GET,
			data: { typeId, name }
		})
	},
	findEveryTypeGoodsCount: () => {
		return request({
			url: `${prefixUrl}/findEveryTypeGoodsCount`,
			method: httpConfig.METHODS.GET
		})
	},
	findAllLackGoods: (typeId, name) => {
		return request({
			url: `${prefixUrl}/findAllLackGoods`,
			method: httpConfig.METHODS.GET,
			data: { typeId, name }
		})
	},
	findOneDetail: (goodsId,isOutbound = false) => {
		return request({
			url: `${prefixUrl}/findOneDetail`,
			method: httpConfig.METHODS.GET,
			data: { goodsId, isOutbound }
		})
	},
	add: data => {
		return request({
			url: `${prefixUrl}/add`,
			method: httpConfig.METHODS.POST,
			data
		})
	},
	update: data => {
		return request({
			url: `${prefixUrl}/update`,
			method: httpConfig.METHODS.POST,
			data
		})
	},
	delete: goodsId => {
		return request({
			url: `${prefixUrl}/delete?goodsId=${goodsId}`,
			method: httpConfig.METHODS.DELETE
		})
	},
	outbound: data => {
		return request({
			url: `${prefixUrl}/outbound`,
			method: httpConfig.METHODS.POST,
			data
		})
	},
}